import React,{Fragment,Component} from "react";
import {GET_LIST_DATA} from './actionCreator'
import {connect} from "react-redux" //连接作用 传参
 import {loadListDataAsyanc} from './actionCreator'
 import Swiper from '@/components/lay_out/swiper/swiper'
class Info extends Component{
    render(){
        console.log(this.props)
        return (
            <Fragment>
                <h1>我是信息页</h1>
                <div>
                    <Swiper/>
                    
                   {/* <ul>
                   {this.props.listData.map((item,index)=>(
                       <li key={index}>
                           {item.get("show_name")}
                       </li>
                   )
                    )}
                   </ul> */}
                   
                   {/* <button onClick={this.props.handTest.bind(this)}>send</button> */}
                </div>
            </Fragment>
        )
    }
}
const mapStateToProps=(store)=>{
    console.log()
    return {
        name:'xxx',
        listData:store.getIn(['infoReducer',"listData"])
    }
}
//里面必需返回一个对象
const mapDispathToProps=(dispatch)=>({
    handTest(){
        // console.log(loadListDataAsyanc)
       dispatch(loadListDataAsyanc(dispatch))//掉完翻一个函数 //传两个dispatch 那边也要写函数
                       //加上 下载thunk可以解决函数 //redux-thunk //可以让dispatch进行异步传输 传入函数
      
    }
})
export default connect(mapStateToProps,mapDispathToProps)(Info);
 